<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Admin Teran Web Page</title>
        <link href="css/jquery-ui-1.10.1.custom.min.css?i=<?=rand();?>" rel="stylesheet" type="text/css">
        <link href="css/main.css?i=<?=rand();?>" rel="stylesheet" type="text/css">
        <link href="css/jquery.dataTables.css?i=<?=rand();?>" rel="stylesheet" type="text/css">
        <link href="css/TableTools.css?i=<?=rand();?>" rel="stylesheet" type="text/css">
        <link href="css/uploadify.css?i=<?=rand();?>" rel="stylesheet" type="text/css">


        <script src="js/jquery-1.9.1.js"></script>
        <script src="js/jqFuncs.js"></script>
        <script src="js/jquery-ui-1.10.1.custom.min.js"></script>
        <script src="js/jquery.dataTables.min.js"></script>
        <script src="js/jquery.uploadify.min.js"></script>

        <script>
            var DOCUMENT_ROOT = 'http://localhost';
            var UPLOAD_FOLDER_ESC_ALQ = "teran/<?=$oEscenografia->getPath()?>alquiler/";
            var UPLOAD_FOLDER_ESC_REALIZ = "teran/<?=$oEscenografia->getPath()?>realizacion/";
            var UPLOAD_FOLDER_VES_ALQ = "teran/<?=$oVestuario->getPath()?>alquiler/";
            var UPLOAD_FOLDER_VES_REALIZ = "teran/<?=$oVestuario->getPath()?>realizacion/";
        </script>
    </head>
    <body>

    <div id="dialog-prevImg" title="&nbsp;">
        <a href="" id="linkFullImg" target="_blank">
            <img class="fullImg" id="fullImg" src="">
        </a>
    </div>

    <div id="deleteImg" style="display:none">
        <form id="formDeleteImg" method="post">
            <input type="text" name="deleteImgId" id="deleteImgId" value=0>
            <input type="text" name="accion" value="deleteImg">
        </form>
    </div>

<!-- Seccion Datos -->
    <div id="dialog-AddInfo" title="Agregar Informacion">
        <form name="formAddInfo" id="formAddInfo" method="post">
            <br/>
            <label>Nombre</label>
            <input class="valorInfo input" name="nombre" value="">
            <br/><br/>
            <label>Valor</label>
            <input class="valorInfo input" name="valor" value="">
            <input type="hidden" name="accion" id="accion" value="addInfo">
        </form>
    </div>
    <div id="dialog-DeleteInfo" title="Borrar Informacion">
        <form name="formDeleteInfo" id="formDeleteInfo" method="post">
            <p>Esta seguro que quiere elimitar el registro?</p>
            <input type="hidden" name="idInfo" id="idDeleteInfo" value="">
            <input type="hidden" name="accion" id="accion" value="deleteInfo">
        </form>
    </div>
    <div id="dialog-editInfo" title="Editar Informacion">
        <form name="formInfo" id="formInfo" method="post">
            <input class="valorInfo input" name="valor" value="">
            <input type="hidden" name="idInfo" id="idInfo" value="">
            <input type="hidden" name="accion" id="accion" value="saveInfo">
        </form>
    </div>

<!-- Seccion Escenografia -->
    <div id="dialog-addEscAlquiler" title="Nuevo Alquler Escenografia">
        <table border=0 width="100%" height="100%">
            <tr>
                <td width="50%" align="center">
                    <img src="" class="prevImg" id="previewUploadImgEsc" >
                </td>
                <td width="50%" rowspan="2" valign="top">
                    <form name="formAddEscAlq" id="formAddEscAlq" method="post">
                        <div>
                            <label>Titulo</label>
                            <input type="text" name="titulo" id="txtTituloAlqEsc" value="">
                        </div>
                        <br>
                        <div>
                            <label>Categoria</label>
                            <select name="categoria" id="cmbCategoriaEsc">
                                <option value="0">- Seleccione -</option>
                                <?php foreach (getCategorias(0) as $k=>$v) { ?>
                                    <option value="<?=$v->getId()?>"><?=$v->getName()?></option>
                                <?php } ?>
                            </select>
                        </div>
                        <input type="hidden" id="imgName" name="imgName">
                        <input type="hidden" id="idImgAlqEsc" name="idImg" value="0">
                        <input type="hidden" id="seccion" name="seccion" value="<?=$config["idEscenografia"]?>">
                        <input type="hidden" id="accion" name="accion" value="addEsc">
                    </form>
                </td>
            </tr>
            <tr>
                <td height="125px" valign="top">
                    <div id="file_upload_Esc_Alq" class="uploadify"></div>
                </td>
            </tr>
        </table>
    </div>

    <div id="dialog-addEscRealiz" title="Nueva Realizacion Escenografia">
        <table border=0 width="100%" height="100%">
            <tr>
                <td width="50%" align="center">
                    <img src="" style="border: 1px solid black; max-width: 220px; max-height: 220px" class="prevImg" id="previewUploadImg2Esc" >
                </td>
                <td width="50%" rowspan="2" valign="top">
                    <form name="formAddEscRealiz" id="formAddEscRealiz" method="post">
                        <div>
                            <label>Titulo</label>
                            <input type="text" name="titulo" id="txtTituloRealizEsc" value="">
                        </div>
                        <input type="hidden" name="categoria" value="0">
                        <input type="hidden" id="idImgRealizEsc" name="idImg" value="0">
                        <input type="hidden" id="imgNameRealizEsc" name="imgName">
                        <input type="hidden" id="seccion" name="seccion" value="<?=$config["idEscenografia"]?>">
                        <input type="hidden" id="accion" name="accion" value="addEscRealiz">
                    </form>
                </td>
            </tr>
            <tr>
                <td height="125px" valign="top">
                    <div id="file_upload_Esc_Realiz" class="uploadify"></div>
                </td>
            </tr>
        </table>
    </div>


<!-- Seccion Vestuario -->
    <div id="dialog-addVesAlquiler" title="Nuevo Alquler Vestuario">
        <table border=0 width="100%" height="100%">
            <tr>
                <td width="50%" align="center">
                    <img src="" class="prevImg" id="previewUploadImgVes" >
                </td>
                <td width="50%" rowspan="2" valign="top">
                    <form name="formAddVesAlq" id="formAddVesAlq" method="post">
                        <div>
                            <label>Titulo</label>
                            <input type="text" name="titulo" id="txtTituloAlqVes" value="">
                        </div>
                        <br>
                        <div>
                            <label>Categoria</label>
                            <select name="categoria" id="cmbCategoriaVes">
                                <option value="0">- Seleccione -</option>
                                <?php
                                $lastCateg = -9;
                                foreach (getCategorias() as $k=>$v) {
                                    if ($lastCateg <> $v->getFatherId()){
                                        $lastCateg = $v->getFatherId();?>
                                        </optgroup>
                                        <optgroup label="<?=$config["secName".$v->getFatherId()]?>">
                                    <?php
                                    }
                                    ?>
                                    <option value="<?=$v->getId()?>"><?=$v->getName()?></option>
                                <?php } ?>
                            </select>
                        </div>
                        <input type="hidden" id="imgNameVes" name="imgName">
                        <input type="hidden" id="idImgAlqVes" name="idImg" value="0">
                        <input type="hidden" id="seccion" name="seccion" value="<?=$config["idVestuario"]?>">
                        <input type="hidden" id="accion" name="accion" value="addVes">
                    </form>
                </td>
            </tr>
            <tr>
                <td height="125px" valign="top">
                    <div id="file_upload_Ves_Alq" class="uploadify"></div>
                </td>
            </tr>
        </table>
    </div>

    <div id="dialog-addVesRealiz" title="Nueva Realizacion Vestuario">
        <table border=0 width="100%" height="100%">
            <tr>
                <td width="50%" align="center">
                    <img src="" style="border: 1px solid black; max-width: 220px; max-height: 220px" class="prevImg" id="previewUploadImg2Ves" >
                </td>
                <td width="50%" rowspan="2" valign="top">
                    <form name="formAddVesRealiz" id="formAddVesRealiz" method="post">
                        <div>
                            <label>Titulo</label>
                            <input type="text" name="titulo" id="txtTituloRealizVes" value="">
                        </div>
                        <input type="hidden" name="categoria" value="0">
                        <input type="hidden" id="idImgRealizVes" name="idImg" value="0">
                        <input type="hidden" id="imgNameRealizVes" name="imgName">
                        <input type="hidden" id="seccion" name="seccion" value="<?=$config["idVestuario"]?>">
                        <input type="hidden" id="accion" name="accion" value="addVesRealiz">
                    </form>
                </td>
            </tr>
            <tr>
                <td height="125px" valign="top">
                    <div id="file_upload_Ves_Realiz" class="uploadify"></div>
                </td>
            </tr>
        </table>
    </div>


